
    <div id='fb-root'></div>
    <script src='http://connect.facebook.net/en_US/all.js'></script>
    <a onclick='postToFeed(); return false;'><img src="..\..\img\facebook_icon_small.jpg"></a>
    <a href="https://twitter.com/intent/tweet?button_hashtag=&text=<%=session.getAttribute("fbCaption") %> on #DashboardCWA3 #peno12" class="twitter-hashtag-button" data-url="http://bit.ly/VmI50U">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <input type="hidden" value="I just achieve a milestone!" id='msg'>
    <script> 
      FB.init({appId: "171214606232384", status: true, cookie: true});

      function postToFeed() {

        // calling the API ...
        var obj = {
          method: 'feed',
          
          link: 'http://dashboardcwa3.appspot.com/',
          picture: 'favicon.ico',
          name: '<%=session.getAttribute("fbName")%>',
          caption: '<%=session.getAttribute("fbCaption")%>',
          description: 'CWA3 Dashboard allows students to track their studying activities and compare these results with their peers.'
        };

        function callback(response) {
          document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
         
        }

        FB.ui(obj, callback);
      }
    
    </script>
